// 演示引入 i18n 插件
// 安装并引入库
import Vue from 'vue'
import VueI18n from 'vue-i18n'

import ElementZH from 'element-ui/lib/locale/lang/zh-CN'
import ElementEN from 'element-ui/lib/locale/lang/en'

import customZH from './zh'
import customEN from './en'

import Cookie from 'js-cookie'

// Vue.use 注册
Vue.use(VueI18n)
// 创建实例
export default new VueI18n({
  locale: Cookie.get('language') || 'zh',
  messages: {
    zh: {
      // el: {
      //   messagebox: {
      //     confirm: '确定'
      //   }
      // },
      // 不用自己写饿了么翻译字典包, 引入即可
      ...ElementZH,
      ...customZH,
      morning: '早安',
      greetings: '祝你开心每一天!',
      confirmDel: '是否确认删除?'
    },
    en: {
      ...ElementEN,
      ...customEN,
      morning: 'Good Morning',
      greetings: 'Have a good day!',
      confirmDel: 'Are you sure?'
    }
  }
})
